<template>
    <div class="login-main-box">
      <div class="login-header-box-main">
        <div class="login-header-box">
          <h1>
            <a href="javascript:;" title='艾罗电站监控系统'>
              <img src="../../assets/img/logo.png">
            </a>
          </h1>
          <div class="login-header-title">
            {{$t('index.site.pro.title')}}
          </div>
        </div>
        <div class="select-language">
          <LangSelect></LangSelect>
        </div>
      </div>
      <div class="login-content-box">
        <div class="title-box">{{$t('login.userName.loginIn')}}</div>
        <div class="content-box">
          <el-row :gutter="24">
            <el-col :span="20" :offset="2">
              <el-form ref="form" :model="form" >
                  <el-form-item  :rules="[{ required: true, message: $t('login-name-notnull')}]" prop="userName">
                    <el-input v-model="form.userName" type='text' :placeholder="$t('userName')" clearable>
                      <template slot="prepend">
                        <i class="el-icon-user"></i>
                      </template>
                    </el-input>
                  </el-form-item>
                  <el-form-item  :rules="[{ required: true, message: $t('login-password-notnull')}]" prop="password">
                    <el-input v-model="form.password" type='text' :placeholder="$t('password')" clearable>
                      <template slot="prepend">
                        <i class="el-icon-unlock"></i>
                      </template>
                    </el-input>
                  </el-form-item>
                  <el-form-item style="margin-bottom:0px;">
                    <div class="button-box-login" @click='loginIn'>
                      {{$t('login.loginIn')}}
                    </div>
                  </el-form-item>
                  <el-form-item>
                    <div class="forget-password">
                      <a href="javascript:;" @click='forgetPassword'>{{$t('forget-password')}}?</a>
                    </div>
                  </el-form-item>
              </el-form>
            </el-col>
          </el-row>
        </div>
      </div>  
      <div class="agreement-box">
        Copyright ©2017 浙江艾罗网络能源技术有限公司
      </div>
    </div>
</template>

<script>
import LangSelect from '@/components/LangSelect'
export default {
    components: {
      LangSelect
    },
    props: {

    },
    data() {
        return {
          form:{
            userName:"",
            password:"",
          }
        };
    },
    computed: {

    },
    watch: {

    },
    created() {

    },
    mounted() {

    },
    methods: {
      loginIn(){
        this.$router.push({ path: '/selectPlatform' })
      },
      forgetPassword(){
        if(!this.form.userName){
          // this.comm.showMsg(false,this.$t('forget-password-msg'))
          this.$confirm(this.$t('forget-password-msg'),this.$t('warmPrompt'))
          .then(_ => {
          })
          .catch(_ => {});
        }
      }
    },
};
</script>

<style  lang="less" >
@media only screen and (max-width: 1560px) {
  .login-content-box{
    margin-top: 50px !important;
  }
}
.login-main-box{
  background-color: skyblue;
  width: 100%;
  height: 100%;
  background: url(../../assets/img/login_bg.jpg) no-repeat;
  padding: 10px 10px;
  box-sizing: border-box;
  overflow-y: hidden;
  .login-header-box-main{
    display: flex;
    justify-content: space-between;
    align-items: center;
    .el-dropdown{
      color: #fff;
    }
    .login-header-box{
      display: flex;
      align-items: center;
      h1{
        margin: 0;
        padding: 0;
      }
      .login-header-title{
        color: #fff;
        font-size: 26px;
        font-weight: 700;
        margin-left: 10px;
      }
    }
  }
  .login-content-box{
    .el-form-item--small.el-form-item{
      margin-bottom: 40px;
    }
    .el-input--small .el-input__inner{
      height: 40px;
    }
    .el-form-item--small .el-form-item__content{
      line-height: 40px;
    }
    width: 430px;
    margin: 0 auto;
    margin-top: 100px;
    background-color: #fff;
    border-radius: 5px;
    .title-box{
      border-radius: 5px 5px 0px 0px;
      background: linear-gradient(#3e70da, #2959ce);
      color: #fff;
      text-align: center;
      padding: 13px;
      font-size: 21px;
      text-shadow: 1px 1px 1px rgba(0,0,0,.5);
    }
    .content-box{
      padding-top: 40px;
      .el-input-group__prepend{
        padding: 0 15px;
      }
      .button-box-login{
        width: 100%;
        background-color: #3e6fde;
        text-align: center;
        color: #fff;
      }
      .forget-password{
        float: right;
        a{
          color: #337ab7;
        }
      }
    }
    
  }
  .agreement-box{
    width: 430px;
    margin: 0 auto;
    text-align: center;
    color: #fff;
    margin-top: 30px;
  }
}
</style>
